package com.ants.boot.core.security.handle;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 蚂蚁会花呗
 * @date 2022/02/11 10:11
 * 退出登录
 */
@Service
public class LogoutClearHandler implements LogoutHandler {

	private static Log logger = LogFactory.getLog(LogoutClearHandler.class);

	@Override
	public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
		logger.info("logout！");
		response.setHeader("Authorization", null);
	}

}
